package com.rui.study.micro.attach.controller;

import com.netflix.discovery.shared.Application;
import com.netflix.eureka.EurekaServerContext;
import com.netflix.eureka.EurekaServerContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description:
 * @author: yaowr
 * @create: 2019-04-16 09:36
 */
@Slf4j
@RestController
@RequestMapping("/api/svr")
public class CustomEurekaController {

    @GetMapping("list")
    public ResponseEntity findServiceList() {

        return new ResponseEntity("list", HttpStatus.OK);
    }

    @PostMapping
    public ResponseEntity findServiceByAppName(@RequestBody String appName) {
        log.info("appname = {}", appName);
        HttpHeaders httpHeaders = new HttpHeaders();
        httpHeaders.setContentType(MediaType.TEXT_PLAIN);
        return new ResponseEntity("xxx", httpHeaders, HttpStatus.OK);
    }
}
